The timing of the program is off. 

312 lines are produced each at 64us for 19.968ms/field. This means samples are clocked out too fast and the write pointer falls behind the read pointer.If 312.5 lines are produced each at 64us then the per field time is correct at 20ms.